<!--{subtemplate inc/header}-->
<div class="blank12"></div>
<div class="hbox">
	<div class="jf-left">
		<!--{advlayout id='积分页广告位宽722px'}-->
		<!--{if count($best_list) > 0}-->
		<div class="jf-title"><strong>强档推荐</strong></div>
		<div class="jf-list">
			<ul>
				<!--{loop $best_list $best_goods}-->
				<li>
					<p class="t"><a href="$best_goods[site_url]" target="_blank" class="s">【{$best_goods[site_name]}】</a>&nbsp;<a href="$best_goods[goods_url]" target="_blank" class="g" title="$best_goods[goods_name]">$best_goods[goods_name]</a></p>
					<p class="i"><a href="$best_goods[goods_url]" target="_blank"><img src="$best_goods[small_img]" alt="$best_goods[goods_name]" /></a></p>
					<p class="l">
						兑换积分：<span>$best_goods[integral]</span><br/>
						库存数量：$best_goods[stock]<br/>
						已换数量：$best_goods[exchange_count]<br/>
						兑换地区：$best_goods[city]
					</p>
					<p class="r">
						<img class="exchange" src="{TPL_PATH}images/jf/btn1.jpg" alt="马上兑换" recID="$best_goods[id]" goodsType="$best_goods[goods_type]"/>
					</p>
				</li>
				<!--{/loop}-->
			</ul>
		</div>
		<div class="blank12"></div>
		<!--{/if}-->
		<div class="jf-title"><strong>兑换专区</strong></div>
		<div class="jf-list">
			<!--{if count($jf_list) > 0}-->
			<ul>
				<!--{loop $jf_list $jf_goods}-->
				<li>
					<p class="t"><a href="$jf_goods[site_url]" target="_blank" class="s">【{$jf_goods[site_name]}】</a>&nbsp;<a href="$jf_goods[goods_url]" target="_blank" class="g" title="$jf_goods[goods_name]">$jf_goods[goods_name]</a></p>
					<p class="i"><a href="$jf_goods[goods_url]" target="_blank"><img src="$jf_goods[small_img]" alt="$jf_goods[goods_name]" /></a></p>
					<p class="l">
						兑换积分：<span>$jf_goods[integral]</span><br/>
						库存数量：$jf_goods[stock]<br/>
						已换数量：$jf_goods[exchange_count]<br/>
						兑换地区：$jf_goods[city]
					</p>
					<p class="r">
						<img class="exchange" src="{TPL_PATH}images/jf/btn1.jpg" alt="马上兑换" recID="$jf_goods[id]" goodsType="$jf_goods[goods_type]"/>
					</p>
				</li>
				<!--{/loop}-->
			</ul>
			<!--{else}-->
			<div class="empty">暂无相关数据</div>
			<!--{/if}-->
		</div>
		<!--{if $settings['exchange_rule'] <> ''}-->
		<div class="blank12"></div>
		<div class="jf-title"><strong>兑换规则</strong></div>
		<div class="jf-content">
			$settings[exchange_rule]
		</div>
		<!--{/if}-->
		<!--{if $settings['integral_rule'] <> ''}-->
		<div class="blank12"></div>
		<div class="jf-title"><strong>积分规则</strong></div>
		<div class="jf-content">
			$settings[integral_rule]
		</div>
		<!--{/if}-->
	</div>
	<div class="jf-right">
		<!--{if $settings['notice'] <> ''}-->
		<dl class="jfr-dl">
			<dt><strong>积分公告</strong></dt>
			<dd class="content">
				$settings[notice]
			</dd>
		</dl>
		<div class="blank12"></div>
		<!--{/if}-->
		<dl class="jfr-dl">
			<dt><strong>邀请好友</strong></dt>
			<dd class="content">
				{if $_FANWE['uid'] > 0}
					<div><input type="text" id="yquser" class="f-input" style="width:156px;" value="{SITE_URL}{eval echo U('user/reg',array('ru'=>$_FANWE['uid']))}" />&nbsp;<input type="button" class="formbutton1" value="复制" style="padding-left:6px;padding-right:6px;" onclick="$.copyText('#yquser');" /></div>
					<div style="padding:10px 0 0 0;">邀请好友注册后，您可获 <strong style="color:#f00;">{$_FANWE['setting']['user_referral_score']}</strong> 积分。 </div>
				{else}
					<div class="empty">登陆后才可以获取邀请链接！</div>
				{/if}
			</dd>
		</dl>
		<div class="blank12"></div>
		<dl class="jfr-dl">
			<dt><strong>兑换快报</strong></dt>
			<dd class="text-list">
				<!--{if count($order_list) > 0}-->
				<ul>
					<!--{loop $order_list $order}-->
					<li><p>$order['create_time_format']&nbsp;会员&nbsp;<span>$order['user_name']</span>&nbsp;兑换了【{$order['site_name']}】$order['data_name']&nbsp;<span>$order['data_num']</span>&nbsp;件</p></li>
					<!--{/loop}-->
				</ul>
				<!--{else}-->
				<div class="empty">暂无相关数据</div>
				<!--{/if}-->
			</dd>
		</dl>
		<div class="blank12"></div>
		<dl class="jfr-dl">
			<dt><strong>积分TOP10</strong></dt>
			<dd class="top">
				<!--{if count($score_list) > 0}-->
				<ul>
					<!--{eval $index = 1;}-->
					<!--{loop $score_list $score_item}-->
					<li><span class="i{if $index < 4} t{/if}">{if $index < 10}0{/if}{$index}</span><span class="u">$score_item[user_name]</span><span class="j">积分：$score_item[score]</span></li>
					<!--{eval $index++;}-->
					<!--{/loop}-->
				</ul>
				<!--{else}-->
				<div class="empty">暂无相关数据</div>
				<!--{/if}-->
			</dd>
		</dl>
		<div class="blank12"></div>
		<dl class="jfr-dl">
			<dt><strong>兑换TOP10</strong></dt>
			<dd class="top">
				<!--{if count($exchange_list) > 0}-->
				<ul>
					<!--{eval $index = 1;}-->
					<!--{loop $exchange_list $exchange_item}-->
					<li><span class="i{if $index < 4} t{/if}">{if $index < 10}0{/if}{$index}</span><span class="u1">$exchange_item[user_name]</span><span class="j j1">兑换了$exchange_item[sum_count]件礼品</span></li>
					<!--{eval $index++;}-->
					<!--{/loop}-->
				</ul>
				<!--{else}-->
				<div class="empty">暂无相关数据</div>
				<!--{/if}-->
			</dd>
		</dl>
	</div>
</div>
<div id="consignee">
	<table border="0" cellpadding="0" cellspacing="1">
		<tr>
			<td class="l">详细地址：</td>
			<td colspan="3"><input type="text" id="c-address" class="f-input" style="width:454px;" value="$consignee[address]" /></td>
		</tr>
		<tr>
			<td class="l">电子邮箱：</td>
			<td><input type="text" id="c-email" class="f-input" style="width:180px;" value="$consignee[email]"/></td>
			<td class="l">邮政编码：</td>
			<td><input type="text" id="c-zip" class="f-input" style="width:180px;" value="$consignee[zip]"/></td>
		</tr>
		<tr>
			<td class="l">手机号码：</td>
			<td><input type="text" id="c-mobile-phone" class="f-input" style="width:180px;" value="$consignee[mobile_phone]"/></td>
			<td class="l">固定电话：</td>
			<td><input type="text" id="c-fax-phone" class="f-input" style="width:180px;" value="$consignee[fax_phone]"/></td>
		</tr>
		<tr>
			<td class="l">传真号码：</td>
			<td><input type="text" id="c-fix-phone" class="f-input" style="width:180px;" value="$consignee[fix_phone]"/></td>
			<td class="l">ＱＱ号码：</td>
			<td><input type="text" id="c-qq" class="f-input" style="width:180px;" value="$consignee[qq]"/></td>
		</tr>
		<tr>
			<td class="l">备　　注：</td>
			<td colspan="3"><textarea id="c-memo" class="f-input" style="width:454px; height:80px;"></textarea></td>
		</tr>
		<tr>
			<td class="l">&nbsp;</td>
			<td colspan="3">
				<input id="submitConsignee" class="formbutton1" type="button" value="兑换" />&nbsp;&nbsp;<input class="formbutton1" id="clearConsignee" type="button" value="取消" />
			</td>
		</tr>
	</table>
</div>
<script type="text/javascript">
var recID = 0;

jQuery(function($){
	$(".jf-list img.exchange").click(function(){
		recID = this.getAttribute("recID");
		goodsType = this.getAttribute("goodsType");
		if(goodsType == 2)
		{
			$.showWindow({"title":"商品兑换","innerObj":$("#consignee")});
			$("#submitConsignee").unbind("click");
			$("#submitConsignee").bind("click",function(){
				$("#fwindow .fwindow_close").click();
				exchangeHandler(true);
			});
		}
		else
			exchangeHandler(false);
	});
});

function exchangeHandler(isConsignee)
{
	var query = new Object();
	query.action = "jifen_exchange";
	query.id = recID;
	
	if(isConsignee)
	{
		query.address = $("#c-address").val();
		query.email = $("#c-email").val();
		query.zip = $("#c-zip").val();
		query.mobilePhone = $("#c-mobile-phone").val();
		query.faxPhone = $("#c-fax-phone").val();
		query.fixPhone = $("#c-fix-phone").val();
		query.qq = $("#c-qq").val();
		query.memo = $("#c-memo").val();
	}
	
	$.ajax({
		type:"GET",
		url: SITE_PATH + "/services/ajax.php",
		data:query,
		cache:false,
		dataType:"json",
		success: function(result){
			alert(result.msg);
		}
	});
}
</script>
<!--{subtemplate inc/footer}-->